<template>
  <div class="item width3">
    <div class="title">待办事项</div>
    <div class="data">
      <div clsss="tab">
        <el-badge :value="page_data.total">
          <el-button size="small" :type="auditType" @click="toggle('audit')">业务审核</el-button>
        </el-badge>
        <el-badge :value="check_vehicle_data.length">
          <el-button size="small" :type="checkVehicleType" @click="toggle('check_vehicle')">车辆年检</el-button>
        </el-badge>
      </div>

      <div class="data_header" v-if="tab_code=='audit'">
        <div class="header_list">序号</div>
        <div class="header_list">所属业务</div>
        <div class="header_list">名称</div>
        <div class="header_list">角色</div>
        <div class="header_list">操作</div>
      </div>
      <div class="data_header" v-if="tab_code=='check_vehicle'">
        <div class="header_list">序号</div>
        <div class="header_list">所属业务</div>
        <div class="header_list"  style="width: 280px;">名称</div>
        <!--            <div class="header_list">角色</div>-->
        <div class="header_list">操作</div>
      </div>
      <div class="data_box">
        <div class="data_list" v-for="(item, key) in todolist_data" :key="key" v-if="tab_code=='audit'">
          <div class="field">{{ key+1 }}</div>
          <div class="field">{{ item.app_name }}</div>
          <div class="field">{{ item.name }}</div>
          <div class="field">{{ item.role_name }}</div>
          <div class="field" v-if="item.app_code == 'basic_business'" >
            <span @click="auditBusiness(item)" v-if="item.action_type == 1">处理</span>
          </div>
          <div class="field" v-else>
            <router-link :to="{path: item.path}">处理</router-link>
          </div>
        </div>
        <div class="data_list" v-for="(item, key) in check_vehicle_data" :key="key"  v-if="tab_code=='check_vehicle'">
          <div class="field">{{ key+1 }}</div>
          <div class="field">{{ item.app_name }}</div>
          <div class="field" style="width: 280px;color:#f56c6c;">{{ item.name }}</div>
          <!--              <div class="field">{{ item.role_name }}</div>-->
          <div class="field" v-if="item.app_code == 'basic_business'" >
            <span @click="checkVehicleDateStatus(item)">处理</span>
          </div>
        </div>
      </div>
      <div class="pagination"  v-if="tab_code=='audit'">
        <Page :small="true" :total="page_data.total" :page.sync="page_data.page" :limit.sync="page_data.limit" @pagination="todolist" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "todolist"
}
</script>

<style scoped>

</style>